package com.smart.campus.school.tcp;

import io.netty.channel.Channel;
public class TCPClient {
    public static void main(String[] args) throws Exception {
        NettyClient client = new NettyClient("49.233.208.162", 2000);
        //启动client服务
        client.start();

        Channel channel = client.getChannel();
        //消息体

        while (true) {


            //channel对象可保存在map中，供其它地方发送消息
            channel.writeAndFlush("你好。我是客户端，收到请回复");
            Thread.sleep(1000);
        }

    }

}
